<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .haha{
            width: 300px;
            height: 200px;
            background-color: red;
        }
        .haha2{
            font-size: 48px;
            color: blue;
        }
    </style>
</head>
<body>
    <div id="mydiv">
        好好好

    </div>
    <script>
        let a =document.getElementById("mydiv")
        //a.classList.add("haha")
        a.classList.add("haha","haha2")
        //a.classList.remove("haha") 这是移除
    </script>
</body>
</html>